package org.dfg.corejava.jdk8.lumbda;

import org.dfg.corejava.jdk8.lumbda.Lumbda2.Itf;

/**
 * 方法引用
 * @author DingFugui
 */
public class Lumbda2 {

	interface Itf {
		void test(String s);
	}

	public static void main(String[] args) {
		L2Class c1 = new L2Class();
		c1.add(e -> {
			System.out.println("lambda写法");
		});

		L2Class c2 = new L2Class();
		c2.add(Lumbda2::doSomething);// 直接引用方法
	}

	public static void doSomething(String s) {
		System.out.println(s);
	}
}

class L2Class {
	void add(Itf i) {

	}
}